package org.br.plotter.gui;

import javax.swing.*;

public class NumericVerifier extends InputVerifier {
	final static NumericVerifier instance = new NumericVerifier();

	public boolean verify(JComponent component) {
		JTextField field = (JTextField) component;
		String asString = field.getText();
		try {
			Double.parseDouble(asString);
			return true;
		} catch (NumberFormatException nex) {
			return false;
		}
	}
}